/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"3262C31C-4EBB-4B25-A527-0F25EE0E40E7",variableType:8}
 */
var fImporte = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"85A66686-C50B-4417-BED9-F8F6EF271D40"}
 */
var f_concepto = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"7266D820-D720-4169-B070-A248B36E8789"}
 * @AllowToRunInFind
 */
function buscar(event) 
{
	var estado_find = controller.find()
	if (estado_find == false)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No encontró datos','OK')
		return;
	}
	var	fecha_busqueda	= utils.dateFormat(globals.gFechaDesde,'dd-MM-yyyy')+'...'+utils.dateFormat(globals.gFechaHasta,'dd-MM-yyyy')
	fecha_mov			= '#'+ fecha_busqueda +'|dd-MM-yyyy'
	if (f_concepto != null)
		concepto			= '%'+ f_concepto + '%'
	if (globals.gProveedorDesde != null)
		proveedor_id		= globals.gProveedorDesde
	if (fImporte != null)
		importe				= fImporte
	
	var found = controller.search()
	if (found == 0)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No encontró datos en el rango pedido','OK')
		return;
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"24D239EA-A8B2-4E04-90B2-916FAA4174C2"}
 */
function anular(event) 
{
	globals.gProveedorDesde = null;
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"1B3BBE0E-3213-44C0-8D54-DDAA9C69E5AD"}
 */
function iraDetalle(event) {
	forms.ctacte_pr_det_2.controller.loadRecords(ctacte_pr_id)
	globals.formEnVentana('ctacte_pr_det_2','CONSULTA_CTACTE','Movimiento de Cuenta Corriente')
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"3601205C-6C6F-424F-BFFA-05E8AAFF7E55"}
 */
function onShow(firstShow, event) {
	databaseManager.revertEditedRecords()
	databaseManager.setAutoSave(true)
}
